<template>
    <el-form :model="addData" label-width="100px">
        <el-form-item label="科室名称" prop="name">
            <el-input v-model="addData.data.name" />
        </el-form-item>
        <el-form-item label="科室主任" prop="maindoctor">
            <el-select v-model="addData.data.maindoctor" placeholder="Please select a zone">
                <el-option label="医生" value="医生" />
                <el-option label="护士" value="护士" />
                <el-option label="医务管理员" value="医务管理员" />
                <el-option label="实习助理" value="实习助理" />
                <el-option label="药房" value="药房" />
            </el-select>
        </el-form-item>
        <el-form-item label="创建时间">
            <el-input placeholder="系统自动生成" />
        </el-form-item>
        <el-form-item label="科室编号">
            <el-input placeholder="系统自动生成" />
        </el-form-item>

        <el-form-item>
            <el-button type="primary" @click="changeEdit">
                确定添加
            </el-button>
        </el-form-item>

    </el-form>
</template>

<script setup lang="ts">
import { reactive, ref } from 'vue';
import { departmentAddReq } from '@/API/Synthesis.api'
import { ElMessage } from 'element-plus'
const dialogFormVisible = ref(false)
const addData = reactive({
    data: {
        maindoctor: '',
        name: ''
    }
})
const changeEdit = async () => {
    const res = await departmentAddReq(addData.data)
    console.log(res);
    if (res.data.code === 1) {
        ElMessage({
            type: 'success',
            message: res.data.msg,
        })
    }

}
</script>

<style scoped>

</style>